package com.syh.app.basic.service.utils;


import java.util.HashMap;


public class WsUtils {
    private static HashMap<String, String> mHashMap = new HashMap<>();

    //BB行情
    public static HashMap<String, String> setSubscribeThumbSPOTJsonMap() {
        mHashMap.clear();
        mHashMap.put(WsConstant.service, WsConstant.SPOT);
        return mHashMap;
    }

    /**
     * 登录
     *
     * @param cookie
     * @return
     */
    public static HashMap<String, String> setLoginJsonMap(String cookie) {
        mHashMap.clear();
        mHashMap.put("sid", cookie);
        return mHashMap;
    }

    /**
     * K线历史数据
     *
     * @param symbol
     * @param from
     * @param to
     * @param resolution
     * @return
     */
    public static HashMap<String, String> setKlineHistoryJsonMap(String symbol, Long from, Long to, String resolution) {
        mHashMap.clear();
        mHashMap.put("symbol", symbol);
        mHashMap.put("from", String.valueOf(from));
        mHashMap.put("to", String.valueOf(to));
        mHashMap.put("resolution", resolution);
        mHashMap.put(WsConstant.service, WsConstant.SPOT);
        return mHashMap;
    }


    /**
     * K线订阅
     *
     * @return
     */
    public static HashMap<String, String> setKlineSubscribeJsonMap(String symbol, String period) {
        mHashMap.clear();
        mHashMap.put("symbol", symbol);
        mHashMap.put("period", period);
        return mHashMap;
    }
}
